Tensor Decomposition of Transformer Key-Value Caches: Spectral Structure and Format Comparison
Transformer KV Cache 的张量分解:谱结构与格式对比
🧭 LLM KV cache 张量分解压缩
Universität Trier
对 KV cache 四阶张量做谱测量,在 2-5× 压缩下 Tucker 重构误差最低,head/layer 近满秩不可压
📌 工作参考价值(4 点)
- 工业 LLM serving 做 KV cache 压缩时,可优先用 2D/SVD 压 key;value 需保留 4 维结构,用 Tucker 且不压 head/layer 轴,同存储下误差更低。
- 压缩预算不要均匀给四个轴:head 和 layer 近满秩,强行压缩收益极低且伤精度;预算应集中在 token 与 feature 轴。
- RoPE 后 key 的可压缩性下降 41%-64%,若做 prefill 缓存或分阶段压缩,尽量在 RoPE 前对 key 做低秩/缓存,或对 post-RoPE key 分配更高 rank。
- value 的错误地板比 key 高,在电商/Agent 长上下文场景做混合 KV cache 管理时,value 应给更高存储比例或更保守压缩。